﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace Qianke.Core.Common.NameMutex
{
    public interface INameMutexManager
    {
        Task<INameMutex> CreateMutex(string mutexName);

        Task<NameMutexCollection> CreateMutex(IEnumerable<string> nameList);

        Task<INameMutex> CreateMutex<TModel>(TModel model,object key);

        Task<INameMutex> CreateMutex<TModel>(TModel model, Func<TModel,object> getKey);
    }
}
